home *** CD-ROM | disk | FTP | other *** search
- Path: soap.news.pipex.net!pipex!usenet
- From: m.hendry@dial.pipex.com (Mathew Hendry)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: 680X0 -> PPC translator?
- Date: Thu, 29 Feb 96 19:28:51
- Organization: Private node.
- Distribution: world
- Message-ID: <19960229.43A058.11BCF@am090.du.pipex.com>
- References: <4h4fk6$f7a@maze.ruca.ua.ac.be>
- NNTP-Posting-Host: am090.du.pipex.com
- X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
-
- Sara Geerens (sgeerens@zorro.ruca.ua.ac.be) wrote:
- : Isn't code from compilers somewhat structured enough? Only pretty messy
- : compilers make messy code... and using complicated code to test between data
- : and code can be done.
-
- Not realistically. There is no way to accurately determine whether a
- particular part of a program is code or data without actually running it - and
- running it exhaustively. Most compilers _do_ misplace code and data within the
- hunk structure, either to take advantage of the speedups available if you use
- near data, or simply due to design faults. A lot of programs also include
- hand-tooled assembly language, whether to provide speedups, or to provide
- functions difficult or impossible to implement well in compiled code. These
- assembly language fragments are much more likely than compiled code to
- misplace code and data in the hunks.
-
- : Maybe you could track every trace it can follow...
- : translation doesn't have to be fast...it only has to run fast... :-)
-
- The time taken to track every path a program can take increases exponentially
- with the complexity of the program and the data it uses. With large programs
- you could never track every possible path within your lifetime - there are
- just too many combinations.
-
- By the time it's finished, the program would be obsolete anyway, probably by
- millions of years ;)
-
- The best method would appear to be on the fly emulation, with online caching
- and subsequent storage of any translated code. In other words, the user would
- be deciding which particular program paths to take, and perhaps translating
- new parts of the program each time it is run.
-
- Managing the storage of the translated code would be complicated, though -
- it's likely that a simple emulator would appear first, with the more advanced
- features coming later. This if only for the reason that the emulator would
- have to be very reliable before attempting to add such features.
-
- -- Mat.
-